    var colorId = null;
    var size = 0;
    
    $(document).on('pagebeforeshow', '#options', function(){  
        setStyle("colors");
        
        size = window.localStorage.getItem("appSize");
        
        var heightClient = parseInt(document.body.clientHeight / 100);
        var max = heightClient;
        var min = 0 - heightClient;        
        
        $('#slider-s').attr('min', min );
        $('#slider-s').attr('max', max );
        $('#slider-s').val(size).slider("refresh");
        
        //change hardware accel
        if (window.localStorage.getItem("cFade") != 'off'){
            $('#flipswitch').val('on').slider("refresh");
        }
        
        $('#flipswitch').change( function(event, ui) {  
            if ($('#flipswitch').val() == 'on'){
                window.localStorage.setItem("cFade",'on');
            }else{
                window.localStorage.setItem("cFade",'off');
            }
            
        });
        
        $( "#slider-s").on('slidestop', function( event ) {
            window.localStorage.setItem("appSize", $('#slider-s').val());
            location.reload();
         });
    });  
      
    function liOnClick(id){
        colorId = id;
        window.localStorage.setItem("appColor", colorId);
        location.reload();
    }
